package com.thejaswi.commons;
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */



/**
 *
 * @author raj
 */
public class AlphaNumericDigits {
    private String alphaNumerics=new String("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ");
    
    public AlphaNumericDigits() {
    }

    /* Returns the alphaNumeric character at the offset of <number>,
     * similar to String.charAt()
     */
    public String getDigit(int number) {
        return this.alphaNumerics.substring(number, number+1);
    }
    /* Returns the integer index position of character <search>,
     * similar to String.indexOf(String)
     */
    public int getDecimalValue(String search) {
        return this.alphaNumerics.indexOf(search.toUpperCase());
    }
    /* Returns the integer index position of character <search>,
     * similar to String.indexOf(char)
     */
    public int getDecimalValue(char search) {
        return this.alphaNumerics.indexOf(String.valueOf(search).toUpperCase());
    }
    /* Returns the total length of the alphaNumeric string,
     * similar to String.length()
     */
    public int length() {
       return this.alphaNumerics.length();
    }
}
